<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateClientTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('client', function (Blueprint $table) {
            $table->increments('client_id');
            $table->string('company_name')->default('')->comment('公司名称');
            $table->string('contact_person')->nullable()->comment('联系人');
            $table->string('contact_phone')->default('')->comment('联系电话');
            $table->string('email')->nullable()->comment('电子邮箱');
            $table->string('industry_type')->nullable()->comment('行业类型');
            $table->tinyInteger('credit_rating')->default('3')->nullable()->comment('信用等级(1-5)');
            $table->integer('contract_count')->default('0')->nullable()->comment('历史合同数量');
            $table->dateTime('create_time')->default('CURRENT_TIMESTAMP')->nullable()->comment('创建时间');
            $table->dateTime('update_time')->nullable()->comment('更新时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('client');
    }
}
